package com.anyou.mall.store.service.impl;

import java.util.List;
import com.anyou.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.anyou.mall.store.mapper.StoShopStoreMapper;
import com.anyou.mall.store.entity.StoShopStore;
import com.anyou.mall.store.service.IStoShopStoreService;

/**
 * 商家店铺Service业务层处理
 *
 * @author ruoyi
 * @date 2023-09-12
 */
@Service
public class StoShopStoreServiceImpl implements IStoShopStoreService
{
    @Autowired
    private StoShopStoreMapper stoShopStoreMapper;

    /**
     * 查询商家店铺
     *
     * @param shopStoreId 商家店铺主键
     * @return 商家店铺
     */
    @Override
    public StoShopStore selectStoShopStoreByShopStoreId(Long shopStoreId)
    {
        return stoShopStoreMapper.selectStoShopStoreByShopStoreId(shopStoreId);
    }

    /**
     * 查询商家店铺列表
     *
     * @param stoShopStore 商家店铺
     * @return 商家店铺
     */
    @Override
    public List<StoShopStore> selectStoShopStoreList(StoShopStore stoShopStore)
    {
        return stoShopStoreMapper.selectStoShopStoreList(stoShopStore);
    }

    /**
     * 新增商家店铺
     *
     * @param stoShopStore 商家店铺
     * @return 结果
     */
    @Override
    public int insertStoShopStore(StoShopStore stoShopStore)
    {
        stoShopStore.setCreateTime(DateUtils.getNowDate());
        return stoShopStoreMapper.insertStoShopStore(stoShopStore);
    }

    /**
     * 修改商家店铺
     *
     * @param stoShopStore 商家店铺
     * @return 结果
     */
    @Override
    public int updateStoShopStore(StoShopStore stoShopStore)
    {
        stoShopStore.setUpdateTime(DateUtils.getNowDate());
        return stoShopStoreMapper.updateStoShopStore(stoShopStore);
    }

    /**
     * 批量删除商家店铺
     *
     * @param shopStoreIds 需要删除的商家店铺主键
     * @return 结果
     */
    @Override
    public int deleteStoShopStoreByShopStoreIds(Long[] shopStoreIds)
    {
        return stoShopStoreMapper.deleteStoShopStoreByShopStoreIds(shopStoreIds);
    }

    /**
     * 删除商家店铺信息
     *
     * @param shopStoreId 商家店铺主键
     * @return 结果
     */
    @Override
    public int deleteStoShopStoreByShopStoreId(Long shopStoreId)
    {
        return stoShopStoreMapper.deleteStoShopStoreByShopStoreId(shopStoreId);
    }
}
